<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登陆界面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <div align="center" style="background-color: antiquewhite;">
    <form action="LoginServlet" id="submit1">	<!-- 登陆成功后的跳转页面 -->
    <table>
        <tr>
            <td align="right">用户名：</td>
            <td><input type="text" name="user" id="user" value=""></td>
        </tr>
        <tr>
            <td align="right">密码：</td>
            <td ><input type="password" name="password" id="password" value=""></td>
        </tr>
    </table>

    <input type="button" id="subm" value="登陆" onclick="sub()"><br/>
    <a href="./register.jsp">没有账号，前往注册</a>
    </form>
</div>
<script type="text/javascript">
    function sub() {
        var user= document.getElementById("user").value;
        if(user.length==0||user.length>20){
            alert("请输入正确的帐号");
            return;
        }else if(document.getElementById("password").value.length==0){
            alert("密码不对");
            return;
        }else{ document.getElementById("submit1").submit();
        console.log("123");
        }

    }
</script>
  </body>
</html>
